package com.wq.gof.designer.lessif;

/**
 * @Author: wangqiang20995
 * @Date:2019/8/7
 * @Description:
 * @Resource:
 */
public enum Operator {

    ADD{
        @Override
        public int apply(int a, int b) {
            return a + b;
        }
    },

    MULTIPLY{
        @Override
        public int apply(int a, int b) {
            return a * b;
        }
    },

    SUB{
        @Override
        public int apply(int a, int b) {
            return a - b;
        }
    },
    DIVIDE{
        @Override
        public int apply(int a, int b) {
            return a / b;
        }
    },
    MODULE{
        @Override
        public int apply(int a, int b) {
            return a % b;
        }
    };
    public abstract int apply(int a,int b);
}
